In order to mine the High Utility Itemsets (HUIs) that meet the special needs of users, such as the specified number of items, a Bat Algorithm for High Utility Itemset Mining based on Length Constraint (HUIM-LC-BA) was proposed. By combining the Bat Algorithm (BA) and length constraints, a new High Utility Itemset Mining (HUIM) model was constructed, in which the database was transformed into a bitmap matrix to realize efficient utility calculation and database scanning. Then the search space was reduced by using the Redefined Transaction Weighted Utility (RTWU) strategy. Finally, the lengths of the itemsets were pruned according to the items determined by roulette bet selection method and depth first search. Experiments on four datasets showed that, when the maximum length was 6, the number of patterns mined by HUIM-LC-BA was reduced by 91%, 98%, 99% and 97% respectively compared with that of HUIM-BA (High Utility Itemset Mining-Bat Algorithm) with less running time; and under different length constraints, the running time of HUIM-LC-BA is more stable compared to the FHM+ (Faster High-utility itemset Ming plus) algorithm. Experimental results indicate that HUIM-LC-BA can effectively mine HUIs with length constraints and reduce the number of mined patterns.